<?
/*
* Smarty plugin
* -------------------------------------------------------------
* File:     function.url.php
* Type:     function
* Name:     link
* Purpose:  zwraca sformatowany url
* -------------------------------------------------------------
*/

function smarty_function_url($param, &$smarty)
{
	if(isset($param['label'])) {
		$label = $param['label'];
	} else {
		$label = null;
	}

	if(isset($param['_BASE_URL_']))
        {
		$baseUrl = $param['_BASE_URL_'];
		unset($param['_BASE_URL_']);
               
		return Router::GenerateUrl($label, $param, $baseUrl);
	}
     
	return Router::GenerateUrl($label, $param);

}
?>